<?php

namespace App\Http\Services\Queue;

class ProcessService {

    public static function Instance($taskName){

        if ($taskName == '') {
            throw new \Exception('任务名称必需');
        }

        $className = 'App\\Http\\Services\\Queue\\'. ucfirst($taskName) . 'Task';
        if(class_exists($className))
        {
            return new $className();
        }
        throw new \Exception('不存在任务'.$taskName);
    }

}